package com.jxk.test.service;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ClassName : SchedulingService  //类名
 * @Description :   //描述
 * @Author : jxk  //作者
 * @Date: 2020-09-21 20:12  //时间
 */
@Service
public class SchedulingService {
    @Scheduled(cron = "0/5 * * * * ? ")
    public void testScheduled(){
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
        String day = simpleDateFormat.format(new Date());
        System.out.println(day);
    }
}
